import { Vector3 } from 'three';

export type StateAspect = {
  aspectName: string;
  affectingProperties: AffectingProperty[];
  stateValues: StateValue[];
  textStateSetting?: TextStateSetting;
};

export type TextStateSetting = {
  pivotPosition: [number, number, number];
  fontSize: number;
  fontColor: [number, number, number];
  fontWeight: FontWeight;
};

export type FontWeight = 'REGULAR' | 'BOLD';

export type AffectingProperty =
  | 'COLOR'
  | 'POSITION'
  | 'ROTATION'
  | 'TEXT'
  | 'VISIBLE';
export type StateValue = { name: string; partSettings: PartSetting[] };

export type PartSetting = {
  targetPartName: string;
  color: number[];
  position: number[];
  rotation: number[];
  visible: boolean;
};

export type ModelInfo = {
  modelId: string; //
  name: string; //
  code: string;
  position: [number, number, number];
  rotation: [number, number, number, string];
  scale: [number, number, number];
  visible: boolean;
  children: ModelInfo[];
  defaultStateSettings: [];
};

export type AlarmItem = {
  grade: string;
  boardCard: string;
  equipment: string;
  data: string;
  time: string;
};

export type SceneJson = {
  version: number;
  boundingBox: {
    center: [number, number, number];
    size: [number, number, number];
  };
  name: string;
  models: ModelInfo[];
};
